package cn.com.gridinfo.sooc.core.my.setting.activity;

import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.jeremy.arad.utils.StringUtils;

import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;
import cn.com.gridinfo.sooc.R;
import cn.com.gridinfo.sooc.base.BaseSoocActivity;

/**
 * 显示认证信息
 * Created by 刘晓晨 on 2016/1/5.
 */
public class RenzhengTypeActivity extends BaseSoocActivity {
    @InjectView(R.id.rzlx)//显示认证类型
            TextView rzlxShow;
    @InjectView(R.id.xm)//显示姓名
            TextView xmShow;
    @InjectView(R.id.sfzh)// 显示身份证号
            TextView sfzhShow;
    private String showSFZ;//隐藏后4位后的身份证号
    private String beforeSFZ;//身份证的前14位
    private String rzlx, xm, sfzh;//定义 认证类型，姓名，身份证号 拿到上个界面传来信息显示

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.my_renzheng_info);
        ButterKnife.inject(this);
        rzlx = getIntent().getStringExtra("rztype");
        xm = getIntent().getStringExtra("xm");
        sfzh = getIntent().getStringExtra("id");
        if(!StringUtils.isNull(rzlx)){
            rzlxShow.setText(rzlx);
        }else{
            rzlxShow.setText("");
        }
        if(!StringUtils.isNull(xm)){
            xmShow.setText(" " + xm);
        }else{
            xmShow.setText("");
        }
        if(!StringUtils.isNull(sfzh) && sfzh.length()>4) {
            beforeSFZ = sfzh.substring(0, sfzh.length() - 4);
            showSFZ = beforeSFZ + "****";
            sfzhShow.setText(" " + showSFZ);
        }else{
            xmShow.setText("");
        }

    }

    //设置标题
    @Override
    public String setupToolBarTitle() {
        return "实名认证";
    }

    //设置左边按钮
    @Override
    public boolean setupToolBarLeftButton(ImageView leftButton) {
        return true;
    }

    //返回
    @OnClick(R.id.toolbar_leftbtn)
    void onGoBack() {
        finish();

    }
}
